package com.ck.client.service.impl;

import java.util.List;

import com.ck.client.dao.ProgramDownloadMapper;
import com.ck.client.model.vo.ProgramPlayListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ck.client.dao.ProgramMapper;
import com.ck.client.model.vo.ProgramVO;
import com.ck.client.service.ProgramService;

/**
 * 节目服务实现类
 *
 * @author linqiang
 * @date 2018-07-19 10:10
 */
@Service(value = "programService")
public class ProgramServiceImpl implements ProgramService {

    @Autowired
    private ProgramMapper programMapper;
    @Autowired
    private ProgramDownloadMapper programDownloadMapper;
    /**
     * 通过版本号获取节目信息
     * @param downloadProgramVersion
     * @return
     */
    @Override
    public ProgramVO getProgramInfoByVersion(String downloadProgramVersion) {
        return programMapper.getProgramByVersion(downloadProgramVersion);
    }

    @Override
    public List<ProgramVO> getNewestProgram(String deviceCode,Long currentMills) {
        return programMapper.getNewestProgram(deviceCode, currentMills);
    }

    @Override
    public List<ProgramPlayListVO> getNewestSourcesByDeviceCode(String deviceCode, List<String> newestProgramVersionList, String resolution) {
        return programMapper.getNewestSourcesByDeviceCode(deviceCode, newestProgramVersionList, resolution);
    }
}
